﻿using System;
using System.Linq;
using System.Collections.Generic;

class LinqRandomNumber
{
    static void Main()
    {
        Random random = new Random();
        List<int> numbers = new List<int>();
        for (int i = 0; i < 100; i++)
        {
            int randomNumber = random.Next(1001);
            numbers.Add(randomNumber);
        }

        var sortedNumbers = numbers.OrderByDescending(n => n).ToList();

        int sum = sortedNumbers.Sum();

        double average = (double)sum / sortedNumbers.Count;

        Console.WriteLine("Sorted Numbers:");
        foreach (var num in sortedNumbers)
        {
            Console.WriteLine(num);
        }

        Console.WriteLine("Sum: " + sum);
        Console.WriteLine("Average: " + average);
    }
}
